﻿using System;
using System.Windows.Controls;
using System.Windows.Navigation;
using Milkify.Data;
using Milkify.Interfaces;

namespace Milkify.Views
{
    /// <summary>
    /// Interaction logic for AuthenticationControl.xaml
    /// </summary>
    public partial class AuthenticationControl : PageFunction<String>, IAuthenticationView
    {
        public AuthenticationControl()
        {
            InitializeComponent();
        }

        #region IView Members

        public object ViewData
        {
            get { return DataContext; }
            set { DataContext = value; }
        }

        #endregion

        #region IAuthenticationView Members

        public string ErrorMessage
        {
            get { return TextErrorMessage.Text; }
            set { TextErrorMessage.Text = value; }
        }

        void IAuthenticationView.Return(bool returnValue)
        {
            OnReturn(new ReturnEventArgs<String>(returnValue.ToString()));
        }

        #endregion
    }
}
